package com.group3.controller;


import com.group3.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * PhotoController
 *
 * @author HY
 * 2021/05/14 11:36
 **/

@RestController
@RequestMapping("/upload")
@Api(tags = "上传文件接口")
@CrossOrigin
public class UploadController {

    @ApiOperation("学生上传头像接口")
    @PostMapping(value = "/student/photo/{studentId}")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "studentId", value = "学生学号",required = true,
                    dataType = "String"),
            @ApiImplicitParam(name = "file", value = "文件流",required = true,
                    dataType = "MultipartFile")
    })
    public Result<String> UploadPhoto(
            @RequestParam("studentId") String studentId,
            @RequestParam("file") MultipartFile file) {

        Result result = null;

        return result;
    }

    @ApiOperation("学生上传附件接口")
    @PostMapping(value = "/student/file/{studentId}")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "studentId", value = "学生学号",required = true,
                    dataType = "String"),
            @ApiImplicitParam(name = "file", value = "文件流",required = true,
                    dataType = "MultipartFile")
    })
    public Result<String> studentFile(
            @RequestParam("studentId") String studentId,
            @RequestParam("file") MultipartFile file) {

        Result result = null;

        return result;
    }

    @ApiOperation("教师上传附件接口")
    @PostMapping(value = "/teacher/file/{teacherId}")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "teacherId", value = "教师工号",required = true,
                    dataType = "String"),
            @ApiImplicitParam(name = "file", value = "文件流",required = true,
                    dataType = "MultipartFile")
    })
    public Result<String> teacherFile(
            @RequestParam("teacherId") String teacherId,
            @RequestParam("file") MultipartFile file) {

        Result result = null;

        return result;
    }



}
